package com.cxy.services;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cxy.dao.UserDao;
import com.cxy.pojo.User;

@Service
@Transactional
public class UserServices {
	@Resource
	private UserDao userDao;
	
	@Transactional(readOnly=true)
	public List<User> find(){
		return userDao.findAll();
	}
	@Transactional(readOnly=true)
	public List<User> findByNotPid(int pid){
		return userDao.findByNotPid(pid);
	}
	@Transactional(readOnly=true)
	public List<User> findByIds(String pram,Integer[] ids){
		return userDao.findByIds(pram, ids);
	}
	@Transactional(readOnly=true)
	public User get(int id){
		return userDao.findById(id);
	}
	public void saveOrUpdate(User user){
		userDao.saveOrUpdate(user);
	}
	public void del(int id){
		userDao.del(id);
	}
	@Transactional(readOnly=true)
	public User login(User user){		
		return (User) userDao.login(user);
	}
}
